<html>
<head>
<style>
body>div {
  margin: 20px 35px;
  float:left;
}
</style>
<script type="text/javascript" src="lib/jquery.min.js"></script>    
<script type="text/javascript" src="lib/jquery-barcode-last.js"></script>  
<script language='javascript'>
function run(){
  
<?php>

ini_set('display_errors', 'On');
error_reporting(E_ALL);

  require_once('functions.php');
  
  
  $db = getConnection();
  
 
  $result = $db->query("select * from groep where id != 0");
 
  foreach($result as $row) {
    echo "$(\"#b".$row['barcode']."\").barcode(\"".$row['barcode']."\", \"code128\", {barWidth:2, barHeight:25});";
  }
?>
}
</script>
</head>
<body onload="run();">

<?php
 
  $result = $db->query("select * from groep where id != 0");

  foreach($result as $row) {
    echo "<div>".$row['kleur']."<div id='b".$row['barcode']."'>".$row['barcode']."</div></div>";
  } 
  closeConnection($db);
?>



</body>
</html>
